package com.zou.common.config;

import com.zou.common.vo.UserVO;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author leonard
 * @Description
 * @date 2021-11-19 17:03
 */
@Slf4j
public class ClientInfoHolder {

    private static final ThreadLocal<UserVO> clientInfoHolder = new ThreadLocal<UserVO>();
    private static Logger logger = LoggerFactory.getLogger(ClientInfoHolder.class);

    public ClientInfoHolder() {
    }

    public static void setClientInfo(UserVO user) {
        clientInfoHolder.set(user);
    }

    public static UserVO getClientInfo() {
        return clientInfoHolder.get();
    }

    public static void clear() {
        clientInfoHolder.remove();
    }

}
